Optimal. Leaf size=78 \[ (a-b)^3 x-\frac {b \left (3 a^2-3 a b+b^2\right ) \cot (c+d x)}{d}-\frac {(3 a-b) b^2 \cot ^3(c+d x)}{3 d}-\frac {b^3 \cot ^5(c+d x)}{5 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 78, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.214, Rules used = {3742, 398, 209}
\begin {gather*} -\frac {b \left (3 a^2-3 a b+b^2\right ) \cot (c+d x)}{d}-\frac {b^2 (3 a-b) \cot ^3(c+d x)}{3 d}+x (a-b)^3-\frac {b^3 \cot ^5(c+d x)}{5 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 209
Rule 398
Rule 3742
Rubi steps
\begin {align*} \int \left (a+b \cot ^2(c+d x)\right )^3 \, dx &=-\frac {\text {Subst}\left (\int \frac {\left (a+b x^2\right )^3}{1+x^2} \, dx,x,\cot (c+d x)\right )}{d}\\ &=-\frac {\text {Subst}\left (\int \left (b \left (3 a^2-3 a b+b^2\right )+(3 a-b) b^2 x^2+b^3 x^4+\frac {(a-b)^3}{1+x^2}\right ) \, dx,x,\cot (c+d x)\right )}{d}\\ &=-\frac {b \left (3 a^2-3 a b+b^2\right ) \cot (c+d x)}{d}-\frac {(3 a-b) b^2 \cot ^3(c+d x)}{3 d}-\frac {b^3 \cot ^5(c+d x)}{5 d}-\frac {(a-b)^3 \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\cot (c+d x)\right )}{d}\\ &=(a-b)^3 x-\frac {b \left (3 a^2-3 a b+b^2\right ) \cot (c+d x)}{d}-\frac {(3 a-b) b^2 \cot ^3(c+d x)}{3 d}-\frac {b^3 \cot ^5(c+d x)}{5 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 2.90, size = 111, normalized size = 1.42 \begin {gather*} -\frac {\cot ^5(c+d x) \left (\frac {15 (a-b)^3 \tanh ^{-1}\left (\sqrt {-\tan ^2(c+d x)}\right ) \tan ^8(c+d x)}{\left (-\tan ^2(c+d x)\right )^{3/2}}+b \left (3 b^2+5 (3 a-b) b \tan ^2(c+d x)+15 \left (3 a^2-3 a b+b^2\right ) \tan ^4(c+d x)\right )\right )}{15 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.10, size = 116, normalized size = 1.49
method | result | size |
norman | \(\frac {\left (a^{3}-3 a^{2} b +3 a \,b^{2}-b^{3}\right ) x \left (\tan ^{5}\left (d x +c \right )\right )-\frac {b^{3}}{5 d}-\frac {b \left (3 a^{2}-3 a b +b^{2}\right ) \left (\tan ^{4}\left (d x +c \right )\right )}{d}-\frac {b^{2} \left (3 a -b \right ) \left (\tan ^{2}\left (d x +c \right )\right )}{3 d}}{\tan \left (d x +c \right )^{5}}\) | \(100\) |
derivativedivides | \(\frac {-\frac {b^{3} \left (\cot ^{5}\left (d x +c \right )\right )}{5}-a \,b^{2} \left (\cot ^{3}\left (d x +c \right )\right )+\frac {b^{3} \left (\cot ^{3}\left (d x +c \right )\right )}{3}-3 a^{2} b \cot \left (d x +c \right )+3 a \,b^{2} \cot \left (d x +c \right )-b^{3} \cot \left (d x +c \right )+\left (-a^{3}+3 a^{2} b -3 a \,b^{2}+b^{3}\right ) \left (\frac {\pi }{2}-\mathrm {arccot}\left (\cot \left (d x +c \right )\right )\right )}{d}\) | \(116\) |
default | \(\frac {-\frac {b^{3} \left (\cot ^{5}\left (d x +c \right )\right )}{5}-a \,b^{2} \left (\cot ^{3}\left (d x +c \right )\right )+\frac {b^{3} \left (\cot ^{3}\left (d x +c \right )\right )}{3}-3 a^{2} b \cot \left (d x +c \right )+3 a \,b^{2} \cot \left (d x +c \right )-b^{3} \cot \left (d x +c \right )+\left (-a^{3}+3 a^{2} b -3 a \,b^{2}+b^{3}\right ) \left (\frac {\pi }{2}-\mathrm {arccot}\left (\cot \left (d x +c \right )\right )\right )}{d}\) | \(116\) |
risch | \(a^{3} x -3 a^{2} b x +3 a \,b^{2} x -b^{3} x -\frac {2 i b \left (45 a^{2} {\mathrm e}^{8 i \left (d x +c \right )}-90 a b \,{\mathrm e}^{8 i \left (d x +c \right )}+45 b^{2} {\mathrm e}^{8 i \left (d x +c \right )}-180 a^{2} {\mathrm e}^{6 i \left (d x +c \right )}+270 a b \,{\mathrm e}^{6 i \left (d x +c \right )}-90 b^{2} {\mathrm e}^{6 i \left (d x +c \right )}+270 a^{2} {\mathrm e}^{4 i \left (d x +c \right )}-330 a b \,{\mathrm e}^{4 i \left (d x +c \right )}+140 b^{2} {\mathrm e}^{4 i \left (d x +c \right )}-180 a^{2} {\mathrm e}^{2 i \left (d x +c \right )}+210 a b \,{\mathrm e}^{2 i \left (d x +c \right )}-70 b^{2} {\mathrm e}^{2 i \left (d x +c \right )}+45 a^{2}-60 a b +23 b^{2}\right )}{15 d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{5}}\) | \(226\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.49, size = 112, normalized size = 1.44 \begin {gather*} a^{3} x - \frac {3 \, {\left (d x + c + \frac {1}{\tan \left (d x + c\right )}\right )} a^{2} b}{d} + \frac {{\left (3 \, d x + 3 \, c + \frac {3 \, \tan \left (d x + c\right )^{2} - 1}{\tan \left (d x + c\right )^{3}}\right )} a b^{2}}{d} - \frac {{\left (15 \, d x + 15 \, c + \frac {15 \, \tan \left (d x + c\right )^{4} - 5 \, \tan \left (d x + c\right )^{2} + 3}{\tan \left (d x + c\right )^{5}}\right )} b^{3}}{15 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 253 vs.
\(2 (74) = 148\).
time = 3.26, size = 253, normalized size = 3.24 \begin {gather*} -\frac {{\left (45 \, a^{2} b - 60 \, a b^{2} + 23 \, b^{3}\right )} \cos \left (2 \, d x + 2 \, c\right )^{3} + 45 \, a^{2} b - 30 \, a b^{2} + 13 \, b^{3} - {\left (45 \, a^{2} b - 30 \, a b^{2} + b^{3}\right )} \cos \left (2 \, d x + 2 \, c\right )^{2} - {\left (45 \, a^{2} b - 60 \, a b^{2} + 11 \, b^{3}\right )} \cos \left (2 \, d x + 2 \, c\right ) - 15 \, {\left ({\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )} d x \cos \left (2 \, d x + 2 \, c\right )^{2} - 2 \, {\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )} d x \cos \left (2 \, d x + 2 \, c\right ) + {\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )} d x\right )} \sin \left (2 \, d x + 2 \, c\right )}{15 \, {\left (d \cos \left (2 \, d x + 2 \, c\right )^{2} - 2 \, d \cos \left (2 \, d x + 2 \, c\right ) + d\right )} \sin \left (2 \, d x + 2 \, c\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.13, size = 126, normalized size = 1.62 \begin {gather*} \begin {cases} a^{3} x - 3 a^{2} b x - \frac {3 a^{2} b \cot {\left (c + d x \right )}}{d} + 3 a b^{2} x - \frac {a b^{2} \cot ^{3}{\left (c + d x \right )}}{d} + \frac {3 a b^{2} \cot {\left (c + d x \right )}}{d} - b^{3} x - \frac {b^{3} \cot ^{5}{\left (c + d x \right )}}{5 d} + \frac {b^{3} \cot ^{3}{\left (c + d x \right )}}{3 d} - \frac {b^{3} \cot {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \left (a + b \cot ^{2}{\left (c \right )}\right )^{3} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 229 vs.
\(2 (74) = 148\).
time = 0.53, size = 229, normalized size = 2.94 \begin {gather*} \frac {3 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 60 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 35 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 720 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 900 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 330 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 480 \, {\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )} {\left (d x + c\right )} - \frac {720 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 900 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 330 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 60 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 35 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 3 \, b^{3}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5}}}{480 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.45, size = 76, normalized size = 0.97 \begin {gather*} x\,{\left (a-b\right )}^3-\frac {b^3\,{\mathrm {cot}\left (c+d\,x\right )}^5}{5\,d}-\frac {{\mathrm {cot}\left (c+d\,x\right )}^3\,\left (3\,a\,b^2-b^3\right )}{3\,d}-\frac {b\,\mathrm {cot}\left (c+d\,x\right )\,\left (3\,a^2-3\,a\,b+b^2\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________